#!/usr/bin/python
# DjangoDE, an integrated development environment for Django
# Copyright (C) 2010-2011 Andrew Wilkinson
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

import logging
import unittest
import sys

from djangode import global_objects
from djangode.tests import *
from djangode.utils import config
from djangode.utils.qt import QtGui

if __name__ == "__main__":
    logging.basicConfig()

    global_objects.app = QtGui.QApplication(sys.argv)

    config._load_config()
    config.CONFIG.clear() # Don't listen to the configuration for the user who is running the tests.
    config.CONFIG.sync()

    # Remove --force-pyqt4 if passed
    if "--force-pyqt4" in sys.argv:
        del sys.argv[sys.argv.index("--force-pyqt4")]

    unittest.main()
